import { RouteRecordRaw } from 'vue-router';

const adminMenus=JSON.parse(localStorage.getItem('adminMenus')+"");
const routeList: Array<RouteRecordRaw> = [];
console.log(JSON.stringify(adminMenus));
routeList.forEach((item:any) => {
    routeList.push({
        path: item.path,
        name: item.code,
        component: () => import(`../../views/${item.component}`),
        meta: {
            title: item.name
        }
    });
});


const routes: Array<RouteRecordRaw> = [
    {
        path: '/manage',
        name: 'manage',
        component: () => import('../../views/manage/Body.vue'),
        // 子菜单
        children: [
            ...routeList
        ]    
    }    
]

export default routes;